//
//  ArgreenViewController.m
//  Kfangchan
//
//  Created by 朋飞 on 14-11-20.
//  Copyright (c) 2014年 Beijing Renjuren Network Technology Co., Ltd. All rights reserved.
//

#import "ArgreenViewController.h"

@interface ArgreenViewController ()

@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
@property (strong, nonatomic) IBOutlet UIWebView *webView;

@end

@implementation ArgreenViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.scrollView.size = CGSizeMake(self.scrollView.width, [UIScreen mainScreen].bounds.size.height - self.navigationController.navigationBar.height);
    
    self.navigationItem.titleView = [[Theam currentTheam] navigationTitleViewWithTitle:@"快房产合作协议"];
    self.navigationItem.leftBarButtonItem = [[Theam currentTheam] navigationBarLeftButtonItemWithImage:[UIImage imageNamed:@"nav_back.png"] Target:self Selector:@selector(back)];
      [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.kfangchan.com/kfc/jsp/module/personal/xy.html"]]];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    NSString *height_str= [webView stringByEvaluatingJavaScriptFromString: @"document.body.offsetHeight"];
    int webHeight = [height_str intValue];
    if (webHeight < 10) {
        webHeight = 10;
    }
    self.webView.size = CGSizeMake(self.webView.width, webHeight);
    
    [self.scrollView setContentSize:CGSizeMake(self.scrollView.width, self.webView.height)];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark 返回
#pragma mark
- (void)back {
    [self.navigationController popViewControllerAnimated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
